if(LITE_WITH_XPU)
  set(IS_FAKED_KERNEL false CACHE INTERNAL "")
  if(LITE_WITH_XTCL)
    add_subdirectory(bridges)
    set(lite_kernel_deps ${lite_kernel_deps} device_xpu ${xpu_subgraph_bridges} CACHE INTERNAL "")
  else()
    set(lite_kernel_deps ${lite_kernel_deps} target_wrapper_xpu CACHE INTERNAL "")
  endif()
elseif(LITE_ON_MODEL_OPTIMIZE_TOOL OR LITE_WITH_PYTHON)
  set(IS_FAKED_KERNEL true CACHE INTERNAL "")
else()
  return()
endif()


if(LITE_WITH_XTCL)
  add_kernel(subgraph_compute_xpu XPU basic SRCS subgraph_compute.cc)
else()
  # basic
  add_kernel(rnn_compute_xpu XPU basic SRCS rnn_compute.cc)
  add_kernel(conv_compute_xpu XPU basic SRCS conv_compute.cc)
  add_kernel(conv2d_transpose_compute_xpu XPU basic SRCS conv2d_transpose_compute.cc)
  add_kernel(calib_compute_xpu XPU basic SRCS calib_compute.cc)
  add_kernel(io_copy_compute_xpu XPU basic SRCS io_copy_compute.cc)
  add_kernel(batch_norm_compute_xpu XPU basic SRCS batch_norm_compute.cc)
  add_kernel(activation_compute_xpu XPU basic SRCS activation_compute.cc)
  add_kernel(pool_compute_xpu XPU basic SRCS pool_compute.cc)
  add_kernel(elementwise_compute_xpu XPU basic SRCS elementwise_compute.cc)
  add_kernel(mul_compute_xpu XPU basic SRCS mul_compute.cc)
  add_kernel(argmax_compute_xpu XPU basic SRCS argmax_compute.cc)
  add_kernel(softmax_compute_xpu XPU basic SRCS softmax_compute.cc)
  add_kernel(scale_compute_xpu XPU basic SRCS scale_compute.cc)
  add_kernel(dropout_compute_xpu XPU basic SRCS dropout_compute.cc)
  add_kernel(matmul_compute_xpu XPU basic SRCS matmul_compute.cc)
  add_kernel(sequence_pad_compute_xpu XPU basic SRCS sequence_pad_compute.cc)
  add_kernel(sequence_mask_compute_xpu XPU basic SRCS sequence_mask_compute.cc)
  add_kernel(gru_compute_xpu XPU basic SRCS gru_compute.cc)
  add_kernel(gru_unit_compute_xpu XPU basic SRCS gru_unit_compute.cc)
  add_kernel(stack_compute_xpu XPU basic SRCS stack_compute.cc)
  add_kernel(slice_compute_xpu XPU basic SRCS slice_compute.cc)
  add_kernel(cast_compute_xpu XPU basic SRCS cast_compute.cc)
  add_kernel(sequence_topk_avg_pooling_compute_xpu XPU basic SRCS sequence_topk_avg_pooling_compute.cc)
  add_kernel(concat_compute_xpu XPU basic SRCS concat_compute.cc)
  add_kernel(search_fc_compute_xpu XPU basic SRCS search_fc_compute.cc)
  add_kernel(reshape_compute_xpu XPU basic SRCS reshape_compute.cc)
  add_kernel(fill_constant_compute_xpu XPU basic SRCS fill_constant_compute.cc)
  add_kernel(fill_constant_batch_size_like_compute_xpu XPU basic SRCS fill_constant_batch_size_like_compute.cc)
  add_kernel(transpose_compute_xpu XPU basic SRCS transpose_compute.cc)
  add_kernel(density_prior_box_compute_xpu XPU basic SRCS density_prior_box_compute.cc)
  add_kernel(yolo_box_compute_xpu XPU basic SRCS yolo_box_compute.cc)
  add_kernel(prior_box_compute_xpu XPU basic SRCS prior_box_compute.cc)
  add_kernel(interpolate_compute_xpu XPU basic SRCS interpolate_compute.cc)
  add_kernel(box_coder_compute_xpu XPU basic SRCS box_coder_compute.cc)
  add_kernel(assign_value_compute_xpu XPU basic SRCS assign_value_compute.cc)
  add_kernel(split_compute_xpu XPU basic SRCS split_compute.cc)
  add_kernel(roi_align_compute_xpu XPU basic SRCS roi_align_compute.cc)
  add_kernel(clip_compute_xpu XPU basic SRCS clip_compute.cc)
  add_kernel(instance_norm_compute_xpu XPU basic SRCS instance_norm_compute.cc)
  add_kernel(sum_compute_xpu XPU basic SRCS sum_compute.cc)
  add_kernel(grid_sampler_compute_xpu XPU basic SRCS grid_sampler_compute.cc)
  add_kernel(fill_zeros_like_compute_xpu XPU basic SRCS fill_zeros_like_compute.cc)
  add_kernel(reduce_compute_xpu XPU basic SRCS reduce_compute.cc)

  # extra
  add_kernel(lookup_table_compute_xpu XPU extra SRCS lookup_table_compute.cc)
  add_kernel(layer_norm_compute_xpu XPU extra SRCS layer_norm_compute.cc)
  add_kernel(sequence_reverse_compute_xpu XPU extra SRCS sequence_reverse_compute.cc)
  add_kernel(sequence_concat_compute_xpu XPU extra SRCS sequence_concat_compute.cc)
  add_kernel(sequence_arithmetic_compute_xpu XPU extra SRCS sequence_arithmetic_compute.cc)
  add_kernel(sequence_pool_compute_xpu XPU extra SRCS sequence_pool_compute.cc)
  add_kernel(match_matrix_tensor_compute_xpu XPU extra SRCS match_matrix_tensor_compute.cc)
  add_kernel(var_conv_2d_compute_xpu XPU extra SRCS var_conv_2d_compute.cc)
  add_kernel(search_grnn_compute_xpu XPU extra SRCS search_grnn_compute.cc)
  add_kernel(sequence_unpad_compute_xpu XPU extra SRCS sequence_unpad_compute.cc)
  add_kernel(lrn_compute_xpu XPU extra SRCS lrn_compute.cc)
  add_kernel(topk_compute_xpu XPU extra SRCS topk_compute.cc)
  add_kernel(im2sequence_compute_xpu XPU extra SRCS im2sequence_compute.cc)
  add_kernel(unstack_compute_xpu XPU extra SRCS unstack_compute.cc)
  add_kernel(norm_compute_xpu XPU extra SRCS norm_compute.cc)
  add_kernel(fill_any_like_compute_xpu XPU extra SRCS fill_any_like_compute.cc)
  add_kernel(pad_constant_like_compute_xpu XPU extra SRCS pad_constant_like_compute.cc)
  add_kernel(gather_compute_xpu XPU extra SRCS gather_compute.cc)
  add_kernel(squeeze_compute_xpu XPU extra SRCS squeeze_compute.cc)
  add_kernel(unsqueeze_compute_xpu XPU extra SRCS unsqueeze_compute.cc)
  add_kernel(flatten_compute_xpu XPU extra SRCS flatten_compute.cc)
  add_kernel(increment_compute_xpu XPU extra SRCS increment_compute.cc)
  add_kernel(assign_compute_xpu XPU extra SRCS assign_compute.cc)
  add_kernel(read_from_array_compute_xpu XPU extra SRCS read_from_array_compute.cc)
  add_kernel(write_to_array_compute_xpu XPU extra SRCS write_to_array_compute.cc)
  add_kernel(generate_proposals_compute_xpu XPU extra SRCS generate_proposals_compute.cc)
  add_kernel(anchor_generator_compute_xpu XPU extra SRCS anchor_generator_compute.cc)
  add_kernel(box_clip_compute_xpu XPU extra SRCS box_clip_compute.cc)
  add_kernel(pad2d_compute_xpu XPU extra SRCS pad2d_compute.cc)
  add_kernel(pixel_shuffle_compute_xpu XPU extra SRCS pixel_shuffle_compute.cc)
  add_kernel(correlation_compute_xpu XPU extra SRCS correlation_compute.cc)
  add_kernel(logical_compute_xpu XPU extra SRCS logical_compute.cc)
  add_kernel(compare_compute_xpu XPU extra SRCS compare_compute.cc)
  add_kernel(is_empty_compute_xpu XPU extra SRCS is_empty_compute.cc)

  # extra(fused kernel)
  add_kernel(__xpu__resnet50_compute_xpu XPU extra SRCS __xpu__resnet50_compute.cc)
  add_kernel(__xpu__block_fuse_compute_xpu XPU extra SRCS __xpu__block_fuse_compute.cc)
  add_kernel(__xpu__resnet_cbam_compute_xpu XPU extra SRCS __xpu__resnet_cbam_compute.cc)
  add_kernel(__xpu__multi_encoder_compute_xpu XPU extra SRCS __xpu__multi_encoder_compute.cc)
  add_kernel(__xpu__embedding_with_eltwise_add_compute_xpu XPU extra SRCS __xpu__embedding_with_eltwise_add_compute.cc)
  add_kernel(__xpu__fc_compute_xpu XPU extra SRCS __xpu__fc_compute.cc)
  add_kernel(__xpu__search_attention_compute_xpu XPU extra SRCS __xpu__search_attention_compute.cc)
  add_kernel(__xpu__search_attention_2_compute_xpu XPU extra SRCS __xpu__search_attention_2_compute.cc)
  add_kernel(__xpu__mmdnn_compute_xpu XPU extra SRCS __xpu__mmdnn_compute.cc)
  add_kernel(__xpu__conv2d_compute_xpu XPU extra SRCS __xpu__conv2d_compute.cc)
  add_kernel(__xpu__sfa_head_compute_xpu XPU extra SRCS __xpu__sfa_head_compute.cc)
  add_kernel(__xpu__softmax_topk_compute_xpu XPU extra SRCS __xpu__softmax_topk_compute.cc)
  add_kernel(__xpu__generate_sequence_compute_xpu XPU extra SRCS __xpu__generate_sequence_compute.cc)
  add_kernel(__xpu__logit_compute_xpu XPU extra SRCS __xpu__logit_compute.cc)
  add_kernel(__xpu__squeeze_excitation_compute_xpu XPU extra SRCS __xpu__squeeze_excitation_compute.cc)
  add_kernel(__xpu__bigru_compute_xpu XPU extra SRCS __xpu__bigru_compute.cc)
  add_kernel(__xpu__conv_pixel_shuffle_compute_xpu XPU extra SRCS __xpu__conv_pixel_shuffle_compute.cc)
  add_kernel(__xpu__dynamic_lstm_compute_xpu XPU extra SRCS __xpu__dynamic_lstm_compute.cc)
endif()
